﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FinanSoft.Utilities;

namespace FinanSoft.BusinessLayer.BuySaleStrategy
{
    public class BuySaleFactory : AbstractFactory
    {
        /// <summary>
        /// Método que se encarga de redirigir el manager para el tipo de docuemento
        /// </summary>
        /// <param name="document">Documento que se desea de guardar en la bd</param>
        /// <param name="docType">´Tipo de documento que se va a guardar</param>
        /// <returns>Retorna si hubo éxito o no</returns>
        public override BuySaleDocManager Create(string docType)
        {
            switch (docType)
            {
                case Constants.OC_ACCOUNTING_ENTRY:
                    return new OrderDocManager();
                case Constants.OV_ACCOUNTING_ENTRY:
                    return new OrderDocManager();
                case Constants.EM_ACCOUNTING_ENTRY:
                    return new MerchandiseDocManager();
                case Constants.EE_ACCOUNTING_ENTRY:
                    return new MerchandiseDocManager();
                case Constants.FP_ACCOUNTING_ENTRY:
                    return new InvoiceDocManager();
                case Constants.FC_ACCOUNTING_ENTRY:
                    return new InvoiceDocManager();
                case Constants.NC_ACCOUNTING_ENTRY:
                    return new CreditNoteDocManager();
                default:
                    return null;
            }
        }
    }
}
